home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0399 / 373 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.7 KB

  1. Subject: `hanging' pipes and zeroed tty pgroups...
  2. Date: Wed, 14 Jul 93 17:22:36 CES
  3. From: Juergen Lock <nox@jelal.north.de>
  4. Message-Id: <9307141522.AA00256@jelal.north.de>
  5.  
  6. me again :)  i somehow forgot to send this one...
  7.  
  8.  quoted from dosmem.c, line 707:
  9.  
  10. >/* release the controlling terminal, if we're a process group leader */
  11. >    fp = curproc->handle[-1];
  12. >    if (fp && is_terminal(fp) && curproc->pgrp == curproc->pid) {
  13. >        struct tty *tty = (struct tty *)fp->devinfo;
  14. >        if (curproc->pgrp == tty->pgrp)
  15. >            tty->pgrp = 0;
  16.             ^^^^^^^^^^^^^
  17.  i think this is a bug :-)
  18.  
  19.  no patch because i'm not sure what exactly to do here (well search for
  20. another process that has the same ctty, but in what order... anyone?)
  21. but you can reproduce the effect when you do something like `sh -c ps |less'
  22. (tried with BSD sh and ksh) and then try to interrupt or stop less with
  23. ^C or ^Z.  either nothing happens (running on /dev/fasttext) or you kill
  24. everything (running on toswin)...
  25.  
  26.  btw i used this to check a ttys pgrp (just redirect its input):
  27.  
  28. -------cut----
  29. #include <stdio.h>
  30. #include <ioctl.h>
  31.  
  32. main(argc,argv)
  33. int argc;
  34. char *argv[];
  35. {
  36.     int fd;
  37.     char *f = "stdin";
  38.     long pgrp;
  39.  
  40.     fd = 0;
  41.     if (!(isatty(fd))) {
  42.         if ((fd = open("U:\\dev\\tty",0)) < 0) {
  43.             perror("can't open tty");
  44.             exit(1);
  45.         }
  46.         f = "/dev/tty";
  47.     }
  48.  
  49.     if (ioctl(fd,TIOCGPGRP,&pgrp)) {
  50.         perror("can't do ioctl");
  51.         exit(1);
  52.     }
  53.  
  54.     printf("%s pgrp: %ld\n", f, pgrp);
  55.  
  56.     exit(0);
  57. }
  58. -----cut----
  59.  
  60.  (and if your stty still ignores redirected input, just recompile with a
  61. newer mintlib... :-)
  62.  
  63.  hope it helps,
  64.     Juergen
  65. -- 
  66. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  67.                                 ...ohne Gewehr
  68. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  69.